How to temporarily disable persistent triggers?

I have two database level persistent triggers set up that import and export objects into a module from another module whenever the module is opened or closed:

 

trigger(NameTriggerDisplay, module->formal->all, post, open, 10, DxlCode)

trigger(NameTriggerRemove, module->formal->all, pre, close, 10, DxlCode)

 

My problem is that when I go to close the module, the deletion trigger tries to open the module in exclusive edit mode so that it can delete all of the imported objects, but this triggers the "display" trigger. 

Is there a way to disable a trigger and then re-enable it again?

Thanks  -Josh


randragon42 - Wed Oct 22 12:41:01 EDT 2014

Re: How to temporarily disable persistent triggers?
randragon42 - Thu Oct 23 09:51:57 EDT 2014

I was able to fix the problem using module level boolean attributes as a sort of locking/semaphore type of solution.

 

My problem now is that when I go to switch from one edit mode to another, my triggers fire because they see that as a closing of the module followed by an opening. Is there any way to detect a switch in the edit mode and disable my triggers for that switch?